package com.application.merecipe.server;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.application.merecipe.shared.Recipe;
import com.sql.database.IRowMapper;

public class RecipeRowMapper implements IRowMapper {

	@Override
	public Object mapRow(ResultSet rs) throws SQLException {
		Recipe recipe = new Recipe();

		recipe.setId(rs.getInt("id"));
		recipe.setTitle(rs.getString("title"));
		recipe.setKeywords(rs.getString("keywords"));
		recipe.setNoPersons(rs.getString("no_persons"));
		recipe.setIngredients(rs.getString("ingredients"));
		recipe.setDescription(rs.getString("description"));
		recipe.setImage(rs.getString("image"));

		return recipe;
	}

}
